<template>
  <div>
    <topNav titleText="我的收藏"></topNav>
    <!-- <postItem></postItem> -->
    <postItem :postData="item" v-for="item in postList" :key="item.id"></postItem>
  </div>
</template>

<script>
//引入头部组件
import topNav from "@/components/topNav";
//引入postItem
import postItem from "@/components/postItem";
export default {
  components: {
    topNav: topNav,
    postItem: postItem
  },
  data() {
    return {
      postList: []
    };
  },
  created() {
    this.$axios({
      url: "/user_star",
      method: "get"
    }).then(res => {
      console.log(res.data);
      this.postList = res.data.data;
      console.log("收藏文章长度");
      console.log(this.postList.length);
    });
  }
};
</script>

<style>
</style>